import Vue from 'vue'
import VueRouter from 'vue-router'

//安装VueRouter
Vue.use(VueRouter)
//导入页面组件
import Home from '../components/Home.vue'
import HelloWorld from '../components/HelloWorld.vue'
import List from '../components/List.vue'
import ListInfo from '../components/ListInfo.vue'
import Ms from '../components/Ms.vue'
import Qg from '../components/Qg.vue'
const router =new VueRouter({
    routes:[
        {
            path:"/",
            redirect:"/home"
        },
        {
            path:"/home",  
            component:Home,
            redirect:"/ms",
            children:[
                {
                    path:'/ms',
                    component:Ms
                },
                {
                    path:'/qg',
                    component:Qg
                }
            ]            
        },
        {
            path:"/hello",
            component:HelloWorld
        },
        {
            path:"/list",
            component:List
        },
        {
            path:"/list/:type",
            component:ListInfo
        }
    ]
})
//导出router对象 以便在其他页面使用
export default router